<%-- 
    Document   : refill_store.jsp
    Created on : Jun 20, 2012, 5:34:15 PM
    Author     : praneeth
--%>

<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>refill_store JSP Page</title>
    </head>
    <body>
        <h1>Account has been refill sucessfully ..!</h1>
   
           <% 
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          
          
   
            String RefillId=request.getParameter("rid");
            String Name=request.getParameter("cname");
            String ConsumerId=request.getParameter("cid");
            String DealerId=request.getParameter("did");
            String SelectDeliveryDate=request.getParameter("day");
            
             //out.println("REFILLID:"+rid);
             //out.println("|| refill");
            
            
            
    String r1="update Refill SET RefillId='"
            +RefillId+"',"
            + "Name='"+Name+"',"
            + "ConsumerId='"+ConsumerId+"',"
            + "DealerID='"+ DealerId + "',"
            + "RefillDate='" + SelectDeliveryDate+"' WHERE RefillId='"+RefillId+"'";
        
        
             System.out.println(r1);
             
     String r2="Refill SET RefillId='"+RefillId+"',Name='"+Name+"',ConsumerId='"+ConsumerId+"'";
       
        
          Connection con=DriverManager.getConnection("jdbc:odbc:egasdsn");
      Statement stmt =con.createStatement();
       int rs=stmt.executeUpdate(r1);
            
        //int rs1=stmt.executeUpdate(q2);    
          //  out.println(q2+"  "+rs1);
            if((rs==1))
            
                   out.println("\nThankyou..! ");
        out.println("Account has been Refill");
      
      
           %>
    </body>
</html
